#include <stdio.h>
#include "StudentMain.h"
void FindStudent(node* head)
{
	int tmp;
	printf("\n欢迎来到查找模式\n");
	printf("\n请输入您查找学生的学号:>");
	scanf("%d", &tmp);
	node* pnode = NodeFind(head, tmp);
	if(pnode == NULL)
	{
		printf("\n没有该学生信息!\n");
	}
	else
	{
		printf("\n该学生信息为:\n");
		printf("学号:%d\n年龄:%d\n姓名:%s\n性别:%s\nC成绩:%d\n",pnode->data->id,pnode->data->age,pnode->data->name,pnode->data->sex,pnode->data->program);
	}
}

node* NodeFind(node* head, int num)
{
	node* tmp;
	tmp = head->next;
	while(tmp != head)
	{
		if(num == tmp->data->id)
		{
			return tmp;
		}
		tmp = tmp->next;
	}
	return NULL;
}
